from mcp.client import Client
import asyncio

async def math_demo():
    async with Client(config_path='config.json') as client:
        # 加法调用
        print("5 + 3 =", await client.call_tool('add_numbers', {'a':5, 'b':3}))
        # 除法错误调用
        print("6 / 0 =", await client.call_tool('divide_numbers', {'a':6, 'b':0}))
        # 平方根调用
        print("√9 =", await client.call_tool('sqrt_number', {'x':9}))

if __name__ == "__main__":
    asyncio.run(math_demo())